const {
    app,
    BrowserWindow,
    Menu 
} = require('electron')
const path = require("path");

Menu.setApplicationMenu(null)
const createWindow = () => {
    const win = new BrowserWindow({
        width: 1200,
        height: 756,
        frame: true,
        webPreferences:{
            nodeIntegration:true,
        }
    })

    // win.loadURL('http://127.0.0.1:5173/')
    // win.webContents.openDevTools()
    win.loadURL(`file://${path.join(__dirname, '../../dist/index.html')}`);
}
app.whenReady().then(() => {
    createWindow()
    app.on('activate', () => {
        if (BrowserWindow.getAllWindows().length === 0) createWindow()
    })
})
app.on('window-all-closed', () => {
    if (process.platform !== 'darwin') app.quit()
})